package com.msmall.community.space.dao.hibernate;

import java.util.List;

import com.msmall.base.dao.hibernate.BaseDaoHibernate;
import com.msmall.community.space.dao.WordsDao;
import com.msmall.community.space.model.Words;

public class WordsDaoHibernate extends BaseDaoHibernate<Words,Long> implements WordsDao{
	public WordsDaoHibernate(){
		super(Words.class);
	}
	
	/**
	 * 获得用户的所有留言
	 */
	public List<Words> getWordsByUserid(Long userid) throws Exception{
		try{
			String queryString = " from Words t where t.receiver = ? order by createTime desc";
			List list = super.getHibernateTemplate().find(queryString, new Object[]{userid});
			return list;
		}catch(Exception e){
			throw e;
		}
	}
	
}
